package misc

import (
	"gitee.com/thghh/jvmgo/instructions/base"
	"gitee.com/thghh/jvmgo/native"
	"gitee.com/thghh/jvmgo/rtda"
)

func init() {
	native.Register("sun/misc/VM", "initialize", "()V", initialize)
}

// private static native void initialize();
// ()V
func initialize(frame *rtda.Frame) {
	classLoader := frame.Method().Class().ClassLoader()
	jSystemClass := classLoader.LoaderClass("java/lang/System")
	method := jSystemClass.GetStaticMethod("initializeSystemClass", "()V")
	base.InvokeMethod(frame, method)
}
